import Layout from '@/layout/index.vue'

const asyncRoutes = [
  {
    path: '/device',
    name: 'Device',
    component: Layout,
    meta: {
      title: '设备管理',
      icon: 'nav-icon icon-device',
      resourceId: 'route:/web/device-management/',
    },
    children: [
      {
        path: '/device/stationList',
        name: 'StationList',
        component: () => import('@/views/device/stationList.vue'),
        meta: {
          title: '充电站管理',
          resourceId: 'route:/web/device-management/station-management/',
          key: (route) => `${route.query.id}`,
        },
      },
      {
        path: '/device/add',
        name: 'StationAdd',
        component: () => import('@/views/device/stationAdd.vue'),
        meta: {
          title: '新增充电站',
          resourceId: 'route:/web/device-management/createstation-management/',
        },
      },
      {
        path: '/device/edit/:id',
        name: 'StationEdit',
        component: () => import('@/views/device/stationAdd.vue'),
        hidden: true,
        meta: {
          title: '编辑电站',
          resourceId: 'route:/web/device-management/createstation-management/',
          activeMenu: '/device',
          key: (route) => `${route.params.id}`,
        },
      },
      {
        path: '/device/copy/:id',
        name: 'StationCopy',
        component: () => import('@/views/device/stationAdd.vue'),
        hidden: true,
        meta: {
          title: '复制电站',
          resourceId: 'route:/web/device-management/createstation-management/',
          activeMenu: '/device',
          key: (route) => `${route.params.id}`,
        },
      },
      {
        path: '/device/stationDetail/:id',
        name: 'StationDetail',
        component: () => import('@/views/device/stationDetail.vue'),
        hidden: true,
        meta: {
          title: '充电站详情',
          resourceId: 'route:/web/device-management/station-management/detail/',
          activeMenu: '/device',
          key: (route) => `${route.params.id}`,
        },
      },
      {
        path: '/device/cycleManagement/:id',
        name: 'StationCycleManagement',
        hidden: true,
        component: () => import('@/views/device/stationCycleManagement.vue'),
        meta: {
          title: '电站停用管理',
          resourceId:
            'route:/web/device-management/station-management/cyclestop/',
          key: (route) => `${route.params.id}`,
        },
      },
      {
        path: '/device/upgrade',
        name: 'DeviceUpgrade',
        component: () => import('@/views/device/deviceUpgrade.vue'),
        meta: {
          title: '设备升级',
          resourceId: 'route:/web/device-management/device-upgrade/',
        },
      },
      {
        path: '/device/deviceList',
        name: 'DeviceList',
        component: () => import('@/views/device/deviceList.vue'),
        meta: {
          title: '设备管理',
          resourceId: 'route:/web/device-management/device-management/',
        },
      },
      {
        path: '/device/deviceHistory',
        name: 'DeviceHistory',
        component: () => import('@/views/device/deviceHistory.vue'),
        meta: {
          title: '设备历史',
          resourceId: 'route:/web/device-management/device-history/',
        },
      },
      {
        path: '/device/deviceAlarm',
        name: 'DeviceHistory',
        component: () => import('@/views/device/deviceAlarm.vue'),
        meta: {
          title: '设备告警',
          resourceId: 'route:/web/device-management/device-history/',
        },
      },
      {
        path: '/device/deviceLog',
        name: 'DeviceLog',
        component: () => import('@/views/device/deviceLog.vue'),
        meta: {
          title: '设备生涯',
          resourceId: 'route:/web/device-management/device-log/', //todo
        },
      },
      {
        path: '/device/electricCardList',
        name: 'ElectricCardList',
        component: () => import('@/views/device/electricCardList.vue'),
        meta: {
          title: '电卡管理',
          resourceId: 'route:/web/device-management/chargeCard-management/',
        },
      },
      {
        path: '/device/electricCardDetail/:cardNum',
        name: 'ElectricCardDetail',
        component: () => import('@/views/device/electricCardDetail.vue'),
        hidden: true,
        meta: {
          title: '电卡详情',
          resourceId:
            'route:/web/device-management/chargeCard-management/detail/',
          activeMenu: '/device',
          key: (route) => `${route.params.cardNum}`,
        },
      },
      {
        path: '/device/electricCardBind',
        name: 'ElectricCardBind',
        component: () => import('@/views/device/electricCardBind.vue'),
        hidden: true,
        meta: {
          title: '电卡绑定',
          resourceId:
            'route:/web/device-management/chargeCard-management/insert/',
          activeMenu: '/device',
        },
      },
      {
        path: '/device/electricCardEdit/:cardNum',
        name: 'ElectricCardEdit',
        component: () => import('@/views/device/electricCardBind.vue'),
        hidden: true,
        meta: {
          title: '电卡编辑',
          resourceId:
            'route:/web/device-management/chargeCard-management/update/',
          activeMenu: '/device',
          key: (route) => `${route.params.cardNum}`,
        },
      },
      {
        path: '/device/snCodeList',
        name: 'SnCodeList',
        component: () => import('@/views/device/snCodeList.vue'),
        meta: {
          title: 'SN编码管理',
          resourceId: 'route:/web/device-management/sn-code/',
        },
      },
    ],
  },
]
export default asyncRoutes
